import math
import re
import os
# 4、生成器

# 1)1234 四个数字能组成多少个互不相同且无重复数字的三位数，各是多少
def getNumber():
    n = int(input("\n请按1继续（输入-1退出程序）: "))
    if n == -1:
        exit()
    if n == 1:
        for x in range(1,5):
            for y in range(1,5):
                for z in range(1,5):
                    if(x != y) and (y != z) and (z != x):
                        print("%d%d%d"%(x, y, z))


# 2)企业发放的奖金根据利润提成。利润（x）低于或等于10万元时，奖金可提10%;
# 10w<x<20w 低于10w的按10%提成，高于10w的按7.5%;
# 20w<x<40w 高于20万部分 5%
# 40w<x<60w 处于之间的 3%
# 60w<x<100w 高于60w 1.5%
# X>100w 超过部分 1%
# 要求：从键盘输入当月利润，求发放的奖金

def getMoney(n):
    if n <= 0:
        exit("参数错误")

    #低于或等于10万元时，奖金可提10%
    elif n <= 10**4:
        s = n*10/100;
        print(s)

    # 10w<x<20w 低于10w的按10%提成，高于10w的按7.5%;
    elif 10**5 < n < 2*10**5:
        s = (n-2*10**5)*7.5/100 + 10**6/100
        print(s)

    # 40w<x<60w 处于之间的 3%
    elif 4*10**5 < n < 6*10**5:
        s = (2*10**5)*3/100
        print(s)

    # 60w<x<100w 高于60w 1.5%
    elif 6*10**5 < n < 10**6:
        s = (n - 6*10**5)*1.5/100
        print(s)

    # x>100w 超过部分 1%
    elif n > 10**6:
        s = (n - 10**6)*1/100
        print(s)

# 3）一个整数，加上100 是个完全平方数，再加上168又是个完全平方数，问该数是多少
def getN():
    for n in range(13, 100):
        m = int(math.sqrt(n*n - 168))
        if m * m == n*n - 168:
            print(n*n - 168 -100)

# 4）输入某年某月某日，判断这一天是这一年的第几天？
def getDate(year, month, day):
    sum = day
    days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
    i = 0
    if( year % 4 == 0 and year % 100 != 0 ) or ( year % 400 == 0 ):
        days[1] = 29
    while i < month - 1:
        sum = sum + days[i]
        i += 1
    print("这一天是该年的第%d天"%(sum))

# 5）输入三个整数x,y,z，请把这三个数由小到大输出。
def getMin(x, y, z):
    ## 第一种
    # if x > y and x > z:
    #     if y > z:
    #         print( z, y, x )
    #     else:
    #         print( y, z, x )
    # if y > x and y > z:
    #     if x > z:
    #         print(z, x, y)
    #     else:
    #         print(x, z, y)
    # if z > x and z > y:
    #     if x > y:
    #         print(y, x, z)
    #     else:
    #         print(x, y, z)

    ##第二种
    # x, y, z = int(x), int(y), int(z)
    # maxNo = max(x, y, z)
    # minNo = min(x, y, z)
    # print(minNo, x+y+z-minNo-maxNo, maxNo)

    ##第三种
    lst = [x, y, z]
    for i in range (len(lst)):
        lst[i] = int(lst[i])
    lst.sort()
    print(lst)

# 6) 用*号输出字母C的图案
def getC():
    text = "123        45"
    clean_str = ' '.join(text.split())
    print(clean_str)

    print("    ****")
    print("  *")
    print("*")
    for i in range(3):
        print ('*')
    print("*")
    print("  *")
    print("    ****")

# 7) 输出9*9口诀
def get99():
    for x in range(1,10):
        for y in range(1, x + 1):
            print("%d*%d=%d"%(x,y,x*y), end = ' ')
        print("")

# 8) 要求输出国际象棋棋盘
def getChineseChess():
    # print(chr(219))
    # for i in range(8):
    #     for j in range(8):
    #         if(i+j)%2 == 0:
    #             print(11, end='')
    #         else:
    #             print("  ", end='')
    #     print('')

    # [
    #     print(chr(219), end='')
    #     if(i+j)%2==0
    #     else print(chr(400), end='')
    #     for i in range(8)
    #     for j in range(8)
    # ]





# 9) 打印楼梯，同时在楼梯上方打印两个笑脸
def getStairs():
    print('1\1\n')
    for i in range(10):
        for j in range(i):
            print(chr(200), end = ' ')
        print('')

# 10) 有一对兔子，从出生后第3个月起每个月都生一对兔子，小兔子长到第三个月后每个月又生一对兔子，假如兔子都不死，问每个月的兔子总数为多少？
def getRabbit():
    a, b = 0, 1
    for i in range(1, 13):
        print("第%d个月：兔子总数为%d只"%(i, b))
        a, b = b, a + b

# 11) 判断101-200之间有多少个素数，并输出所有素数
def getPrime():
    L = []
    for i in range(101, 200):
        for j in range(2, i - 1):
            if i%j == 0:
                break
        else:
            L.append(i)
    print(L)

# 12）阿姆斯特朗数 如果一个n位正整数等于其各位数字的n次方之和, 则称该数为阿姆斯特朗数。 例如1^3 + 5^3 + 3^3 = 153。
def armstrongnumber():
    for i in range(10, 1000000):
        sum = 0
        for j in str(i):
            sum += int(j)**len(str(i))
            if sum == i:
                print (i)

# 13）创建一个generator
def getGenerator():
    # print((x*x for x in range(10)))
    a, b = 0, 1
    while True:
        yield a
        a, b = b, a + b

# 14）创建一个generator
def fab(max):
    # print((x*x for x in range(10)))
    a, b, c = 0, 0, 1
    while a < max:
        yield c
        c = c+b
        b = c-b
        a = a+1

# 15）判断字符串是否全部是小写
def islower(str):
    print(str.islower())

# 16）判断字符串是否为空
def isspace(str):
    print(str.isspace())

# 17）查询字符串函数库
def helps(str):
    print(help(str))

# 18) 字符串替换函数
def replaces(str, old, new):
    print(str.replace(old, new))

# 19) 判断字符串是否是大写
def isupper(str):
    print(str.isupper())



if __name__ == '__main__':

    # print(math.sin(30))
    # print(math.pi)
    # print(math.pow(2, 4))
    # print(2**4)
    # print(os.getcwd())
    # print(os.listdir())
# -----------------------------------------
#     str = input("\n请输入字符串：")
#     isupper(str) #返回新的字符串
# # -----------------------------------------
    # str = input("\n请输入需要操作的字符串：")
    # old = input("\n请输入被替换的字符串：")
    # new = input("\n请输入新的字符串：")
    # replaces(str, old, new) #返回新的字符串
# -----------------------------------------
    # str = input("\n请输入字符串：")
    # helps(str) #返回True或False
# -----------------------------------------
    # str = input("\n请输入字符串：")
    # isspace(str) #返回True或False
# -----------------------------------------
    # str = input("\n请输入字符串：")
    # islower(str) #返回True或False
# -----------------------------------------
    # max = int(input("\n请输入max："))
    # for n in fab(max):
    #     print(n)
# -----------------------------------------
    # f = getGenerator()
    # print(f, next(f), next(f))
# -----------------------------------------
    # armstrongnumber()
# -----------------------------------------
    # getNumber()
# -----------------------------------------
    # n = int(input("\n请输入利润值："))
    # getMoney(n)
# -----------------------------------------
    # getN()
# -----------------------------------------
    # year = int(input("\n请输入年份: "))
    # month = int(input("\n请输入月份: "))
    # day = int(input("\n请输入日份: "))
    # getDate( year, month, day )
# -----------------------------------------
    # x = int(input("\n请输入x: "))
    # y = int(input("\n请输入y: "))
    # z = int(input("\n请输入z: "))
    # getMin(x, y, z)
# -----------------------------------------
    # getC()
# -----------------------------------------
    # get99()
# -----------------------------------------
    getChineseChess()
# -----------------------------------------
    # getStairs()
# -----------------------------------------
    # getRabbit()
# -----------------------------------------
    # getPrime()
